/***********************************************************************************
* Piece Square Tables
* Francisco Tort
* March 18, 2014
*/
#include "Definitions.h"
#include "ChessGame.h"

/*************************************************************************
//http://chessprogramming.wikispaces.com/Simplified+evaluation+function
************************************************************************/
// pawn
int ChessGame::PSQT_P[64] = {
// 0,  0,  0,  0,  0,  0,  0,  0,
//50, 50, 50, 50, 50, 50, 50, 50,
//10, 10, 20, 30, 30, 20, 10, 10,
// 5,  5, 10, 25, 25, 10,  5,  5,
// 0,  0,  0, 20, 20,  0,  0,  0,
// 5, -5,-10,  0,  0,-10, -5,  5,
// 5, 10, 10,-20,-20, 10, 10,  5,
// 0,  0,  0,  0,  0,  0,  0,  0};
//int ChessGame::PSQT_P[64] = {
 0,  0,  0,  0,  0,  0,  0,  0,
50, 90,120,150,150,120, 90, 50,
10, 45, 60, 75, 75, 60, 45, 10,
 5,  5, 10, 30, 30, 10,  5,  5,
 0,  0,  0, 25, 25,  0,  0,  0,
 5, -5,-10,  0,  0,-10, -5,  5,
 5, 10, 10,-20,-20, 10, 10,  5,
 0,  0,  0,  0,  0,  0,  0,  0};

// knight
 int ChessGame::PSQT_N[64] = {
-50,-40,-30,-30,-30,-30,-40,-50,
-40,-20,  0,  0,  0,  0,-20,-40,
-30,  0, 10, 15, 15, 10,  0,-30,
-30,  5, 15, 60, 60, 15,  5,-30,
-30,  0, 15, 20, 20, 15,  0,-30,
-30,  5, 10, 15, 15, 10,  5,-30,
-40,-20,  0,  5,  5,  0,-20,-40,
-50,-40,-30,-30,-30,-30,-40,-50};


// bishop
int ChessGame::PSQT_B[64] = {
-20,-10,-10,-10,-10,-10,-10,-20,
-10,  0,  0,  0,  0,  0,  0,-10,
-10,  0,  5, 10, 10,  5,  0,-10,
-10,  5,  5, 10, 10,  5,  5,-10,
-10,  0, 60, 10, 10, 60,  0,-10,
-10, 20, 30, 10, 10, 30, 20,-10,
-10,  5,  0,  0,  0,  0,  5,-10,
-20,-10,-30,-10,-10,-30,-10,-20};


//rook
 int ChessGame::PSQT_R[64] = {
  0,  0,  0,  0,  0,  0,  0,  0,
  5, 50, 50, 50, 50, 50, 50,  5,
 -5,  0,  0,  0,  0,  0,  0, -5,
 -5,  0,  0,  0,  0,  0,  0, -5,
 -5,  0,  0,  0,  0,  0,  0, -5,
 -5,  0,  0,  0,  0,  0,  0, -5,
 -5,  0,  0,  0,  0,  0,  0, -5,
 0,  0,  0,  5,  5,  0,  0,  0};


//queen
 int ChessGame::PSQT_Q[64] = {
-20,-10,-10, -5, -5,-10,-10,-20,
-10,  0,  0,  0,  0,  0,  0,-10,
-10,  0,  5,  5,  5,  5,  0,-10,
 -5,  0,  5,  5,  5,  5,  0, -5,
  0,  0,  5,  5,  5,  5,  0, -5,
-10,  5,  5,  5,  5,  5,  0,-10,
-10,  0,  5,  0,  0,  0,  0,-10,
-20,-10,-10, -5, -5,-10,-10,-20};


//king middle game
 int ChessGame::PSQT_K[64] = {
-30,-40,-40,-50,-50,-40,-40,-30,
-30,-40,-40,-50,-50,-40,-40,-30,
-30,-40,-40,-50,-50,-40,-40,-30,
-30,-40,-40,-50,-50,-40,-40,-30,
-20,-30,-30,-40,-40,-30,-30,-20,
-10,-20,-20,-20,-20,-20,-20,-10,
 20, 20,  0,  0,  0,  0, 20, 20,
 20, 30, 10,  0,  0, 10, 30, 20};


// king end game
 int ChessGame::PSQT_KEG[64] = {
-50,-40,-30,-20,-20,-30,-40,-50,
-30,-20,-10,  0,  0,-10,-20,-30,
-30,-10, 20, 30, 30, 20,-10,-30,
-30,-10, 30, 40, 40, 30,-10,-30,
-30,-10, 30, 40, 40, 30,-10,-30,
-30,-10, 20, 30, 30, 20,-10,-30,
-30,-30,  0,  0,  0,  0,-30,-30,
-50,-30,-30,-30,-30,-30,-30,-50};

